import { V2 } from './V2';
import { McSpriteAni } from './McSpriteAni';
//import begin

/**
 * 在McSpriteAni的基础上增加了frameLoop功能
 * 主要用于一些不需要代码控制的简单的帧动画播放
 * 比如UI特效、精英怪脚底的法阵等
 */
export default class McSpriteAuto extends McSpriteAni {
    public param: string = null;

    constructor(pos: V2 = V2.ZERO, zOrder: number = 0, completeHandler: Laya.Handler = null, completeClear: boolean = true) {
        super(pos, zOrder, completeHandler, completeClear);
    }

    onAwake(): void {
        Laya.timer.frameLoop(1, this, this.onUpdate);
    }

    onDestroy(): void {
        Laya.timer.clearAll(this);
    }
}